

import java.math.BigInteger;

public class Main{

	public static BigInteger[] factorials = new BigInteger[101];

	// get trailing zero in n!
	public static BigInteger fact(int n) {
		BigInteger answer = null;
		if (!factorials[n].equals(new BigInteger("0"))) {
			answer = factorials[n];
		} else {
			answer = (new BigInteger("" + n)).multiply(fact((n - 1)));
			factorials[n] = answer;
		}
		return answer;
	}

	public static void main(String[] args) throws java.lang.Exception {
		factorials[0] = new BigInteger("1");
		factorials[1] = new BigInteger("1");
		for (int i = 2; i < factorials.length; i++) {
			factorials[i] = new BigInteger("0");
		}
		java.io.BufferedReader r = new java.io.BufferedReader(
				new java.io.InputStreamReader(System.in));
		int number = Integer.parseInt(r.readLine());

		for (int i = 0; i < number; i++) {
			String s = r.readLine().trim();
			System.out.println(fact(Integer.parseInt(s)).toString());
		}
	}
}
